package model

import "time"

type Plan struct {
	ID          uint      `gorm:"primaryKey" json:"id"`
	MemberID    uint      `gorm:"not null" json:"memberId"`
	CoachID     uint      `gorm:"not null" json:"coachId"`
	Name        string    `gorm:"size:100;not null" json:"name"`
	Description string    `gorm:"type:text" json:"description"`
	Goal        string    `gorm:"size:200" json:"goal"`     // 训练目标
	Content     string    `gorm:"type:text" json:"content"` // 计划内容(JSON)
	StartDate   time.Time `json:"startDate"`
	EndDate     time.Time `json:"endDate"`
	Status      int       `gorm:"default:1" json:"status"` // 1:进行中 2:已完成 0:已取消
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type PlanCreateReq struct {
	MemberID    uint   `json:"memberId" binding:"required"`
	CoachID     uint   `json:"coachId" binding:"required"`
	Name        string `json:"name" binding:"required"`
	Description string `json:"description"`
	Goal        string `json:"goal"`
	Content     string `json:"content"`
	StartDate   string `json:"startDate" binding:"required"`
	EndDate     string `json:"endDate" binding:"required"`
}

type PlanUpdateReq struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Goal        string `json:"goal"`
	Content     string `json:"content"`
	StartDate   string `json:"startDate"`
	EndDate     string `json:"endDate"`
	Status      *int   `json:"status"`
}
